<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="alert('有人点击了我')">点击我</button>
<button onclick="funA()">点击我2</button>
<button id="b3">点击我3</button>
</body>
</html>

<script>
    function funA() {
        document.write("Hello,world!<br/>");
        document.write("你好，世界！")
    }

    document.getElementById("b3").onclick = function () {
        alert("你点击了我")
    }
</script>